package br.com.imob.modelo;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author Gilton Nascimento
 */
@Entity
@Table(name = "\"TIPO_IMOVEL\"", catalog = "imob", schema = "public")
@NamedQueries({
    @NamedQuery(name = "TipoImovel.findAll", query = "SELECT t FROM TipoImovel t"),
    @NamedQuery(name = "TipoImovel.findByTipoImovelId", query = "SELECT t FROM TipoImovel t WHERE t.tipoImovelId = :tipoImovelId"),
    @NamedQuery(name = "TipoImovel.findByTipoImovel", query = "SELECT t FROM TipoImovel t WHERE t.tipoImovel = :tipoImovel"),
    @NamedQuery(name = "TipoImovel.findLikeByTipoImovel", query = "SELECT t FROM TipoImovel t WHERE t.tipoImovel Like :tipoImovel")
    })
public class TipoImovel implements Serializable {
    
	private static final long serialVersionUID = 1L;

    @Id
//  <editor-fold defaultstate="collapsed" desc="Geradores de Sequencias">
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_STORE")
    @SequenceGenerator(name = "SEQ_STORE", sequenceName = "next_tipoimovel")// </editor-fold>
    @Basic(optional = false)
    @Column(name = "tipo_imovel_id", nullable = false)
    private Integer tipoImovelId;
    
    @Basic(optional = false)
    @Column(name = "tipo_imovel", nullable = false, length = 40)
    private String tipoImovel;
    
    public TipoImovel() { }

    public TipoImovel(Integer tipoImovelId) {
        this.tipoImovelId = tipoImovelId;
    }

    public TipoImovel(String tpImovel) {
    	tipoImovel = tpImovel;
    }
    
    public TipoImovel(Integer tipoImovelId, String tipoImovel) {
        this.tipoImovelId = tipoImovelId;
        this.tipoImovel = tipoImovel;
    }


	public Integer getTipoImovelId() {
        return tipoImovelId;
    }

    public void setTipoImovelId(Integer tipoImovelId) {
        this.tipoImovelId = tipoImovelId;
    }

    public String getTipoImovel() {
        return tipoImovel;
    }

    public void setTipoImovel(String tipoImovel) {
        this.tipoImovel = tipoImovel;
    }
    
    
    public Object[] getValues() {
    	Object[] objects = {tipoImovelId, tipoImovel};
    	return objects; 
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tipoImovelId != null ? tipoImovelId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof TipoImovel)) {
            return false;
        }
        TipoImovel other = (TipoImovel) object;
        if ((this.tipoImovelId == null && other.tipoImovelId != null) || (this.tipoImovelId != null && !this.tipoImovelId.equals(other.tipoImovelId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.imob.modelo.TipoImovel[tipoImovelId=" + tipoImovelId + "]";
    }

}
